package Member.selevrct;

import Member.entiy.Member;
import Member.servise.MemberSers;
import Member.servise.impl.MemberSerImpl;


import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/MemberServletDelete")
public class MemberServletDelete extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        String memberIDStr=request.getParameter("memberID");
        int memberID=memberIDStr!=null?Integer.parseInt(memberIDStr):0;

        MemberSers service=new MemberSerImpl();

        Member snacks=new Member();
        snacks.setMemberID(memberID);

        int count=service.deletInfor(snacks);

        PrintWriter out=response.getWriter();
        out.print(count);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }
}
